<!DOCTYPE HTML>
<html>

<head>
        <title></title>

        <script type="text/javascript">

function myclass () 
{
  this.a;
  this.b;
  this.print = function () 
  {
    alert(this.a+" "+this.b);
  }
}

var x = "global";
function f() {
    //var x = "local";
    function g() { alert(x); }
    g();
}
        </script>

        <style type="text/css">
        </style>
</head>



<body>

        <script type="text/javascript">


f();  // Calling this function displays "local"
alert(x);
var myobj = new myclass();
myobj.a = "nihao";
myobj.b = "zaijian";
myobj.print();

        </script>
</body>



</html>

